<template>
	<view class="flex-col page">
		<view>
			<view :style="{height:statusBarHeight+'px'}"></view>
			<u-navbar title="公告" bgColor="#F5F5F5" @leftClick="$nav(2)">	
			</u-navbar>
		</view>
		
		<view>
			<view class="top">
				<view class="title" style="color: #7d4802;">{{title}}</view>
			</view>
			<scroll-view :scroll-top="scrollTop" :scroll-y="true" class="scroll-Y" @scroll="scroll">
				<view class="content" style="color: #333;">
					<rich-text :nodes="content"></rich-text>
				</view>
			</scroll-view>
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title:'',
				content:'',
				scrollTop: 0,
				old: {
					scrollTop: 0
				}
			};
		},
		onLoad(op) {
			let c = decodeURIComponent(op.content)
			this.title = op.title
			this.content = c
		},
		computed:{
			statusBarHeight(){
				return this.$store.state.statusBarHeight + 44
			}
		},
		methods:{
			scroll(e) {
				this.old.scrollTop = e.detail.scrollTop
			},
		}
	}
</script>

<style lang="scss">
.page{
	width: 100%;
	overflow-y: auto;
	overflow-x: hidden;
	height: 100%;
}
.top {
	font-size: 38rpx;
	text-align: center;
	font-weight: bold;
	margin-top: 60rpx;
}
.scroll-Y {
	margin-top: 20rpx;
	height: 48vh;
	
}
.content {
	margin: 0 30rpx;
}
</style>
